<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">


	<rich:spacer height="30" />
	<a4j:form>
		<a4j:status>
			<f:facet name="start">
				<h:graphicImage value="/img/spinner.gif" />
			</f:facet>
		</a4j:status>
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="Adding a new participant" />
			</f:facet>
			<h:panelGrid columns="3" width="400">
				<h:outputText value="Name" />
				<h:outputText value="Description" />
				<h:outputText value="" />
				<h:inputText value="#{participantsManage.newParticipantName}" />
				<h:inputText value="#{participantsManage.newParticipantDesc}" />
				<a4j:commandButton value="Add" reRender="allparts"
					action="#{participantsManage.addParticipant}" />
			</h:panelGrid>
		</rich:panel>
	</a4j:form>
	<a4j:form>
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="Browsing existing participants" />
			</f:facet>
			<rich:dataTable rowKeyVar="rkv" value="#{participantsManage.all}"
				var="participant" rows="10" width="400" id="allparts"
				onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
				onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
				<rich:column id="namePartCol">
					<f:facet name="header">
						<h:outputText styleClass="headerText" value="Name" />
					</f:facet>
					<h:outputText value="#{participant.name}" />
				</rich:column>
				<rich:column id="descPartCol">
					<f:facet name="header">
						<h:outputText styleClass="headerText" value="Description" />
					</f:facet>
					<h:outputText value="#{participant.description}" />
				</rich:column>
				<rich:column id="partDelCol">
					<f:facet name="header">
						<h:outputText styleClass="headerText" value="Delete" />
					</f:facet>
					<a4j:commandLink
						action="#{participantsManage.removeParticipant(participant)}"
						reRender="allparts" value="Delete" />
				</rich:column>
				<f:facet name="footer">
					<rich:datascroller align="center" />
				</f:facet>
			</rich:dataTable>
		</rich:panel>
	</a4j:form>

</ui:composition>